(function(){"use strict";BX.namespace("BX.Landing.UI.Field");BX.Landing.UI.Field.BlockSource=function(e){BX.Landing.UI.Field.BaseField.apply(this,arguments);BX.Landing.Utils.addClass(this.layout,"landing-ui-field-block-source");this.onSourceChangeHandler=e.onSourceChange;this.value=e.value;this.sourceField=this.createLinkField();this.layout.innerHTML="";BX.Landing.Utils.append(this.sourceField.layout,this.layout)};BX.Landing.UI.Field.BlockSource.prototype={constructor:BX.Landing.UI.Field.BlockSource,__proto__:BX.Landing.UI.Field.BaseField.prototype,getSources:function(){return BX.Landing.Main.getInstance().options.sources},createLinkField:function(){return new BX.Landing.UI.Field.LinkUrl({selector:"source",title:BX.Landing.Loc.getMessage("LANDING_BLOCK__SOURCE_TITLE"),textOnly:true,disableCustomURL:true,disablePages:true,disallowType:true,allowedTypes:[BX.Landing.UI.Field.LinkUrl.TYPE_BLOCK],customPlaceholder:BX.Landing.Loc.getMessage("LANDING_BLOCK__BLOCK_SOURCE_PLACEHOLDER"),options:{siteId:BX.Landing.Main.getInstance().options.site_id,landingId:BX.Landing.Main.getInstance().id,filter:{"=TYPE":BX.Landing.Main.getInstance().options.params.type}},content:this.value,onValueChange:function(e){var n=null;if(BX.type.isPlainObject(e)&&BX.type.isPlainObject(e.source)){n=Object.keys(e.source)[0]}var i=this.getSources().find((function(e){return e.id===n}));setTimeout(function(){this.onSourceChangeHandler(i)}.bind(this),0)}.bind(this)})},getValue:function(){return this.sourceField.getValue()}}})();
//# sourceMappingURL=block_source_field.map.js